//
//  STHairerHeadView.m
//  YiYueStore
//
//  Created by zhouzhouzhou on 2018/10/16.
//  Copyright © 2018年 YuYiLian. All rights reserved.
//

#import "STHairerHeadView.h"

@implementation STHairerHeadView

-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    headFrame = frame;
    [self loadHeaderView];
    return self;
}

-(void)setOwnCollectionCellWithData:(STDoorHairerModel *)data{
    
    [headImg sd_setImageWithURL:[NSURL URLWithString:data.coverImg] placeholderImage:[UIImage imageNamed:@"h-hairEg2"]];
    nameLab.text = data.stylistName;
}

-(void)loadHeaderView{
    headImg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(headFrame), CGRectGetHeight(headFrame)*0.8)];
    nameLab = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetHeight(headFrame)*0.8, CGRectGetWidth(headFrame), CGRectGetHeight(headFrame)*0.2)];
    nameLab.textAlignment = NSTextAlignmentCenter;
    nameLab.font = FONT(13);
    
    UIView * back = [[UIView alloc]initWithFrame:headFrame];
    back.backgroundColor = [UIColor whiteColor];
    back.layer.cornerRadius = 5;
    back.layer.shadowColor = [UIColor blackColor].CGColor;
    back.layer.shadowOffset = CGSizeMake(0, 0);
    back.layer.shadowRadius = 3;
    back.layer.shadowOpacity = 0.5;
    
    [self addSubview:back];
    [self addSubview:headImg];
    [self addSubview:nameLab];
    
}

@end
